<?php

function smarty_function_implode($params, &$smarty)
{
    if(!is_array($params['array'])) {
        print 'Type is '.gettype($params['array']);
        throw new InvalidArgumentException();
    }
    return implode($params['separator'],$params['array']);
}